<template>
  <van-tabbar v-model="active" route>
    <template v-for="item in list">
      <van-tabbar-item :key="item.id" :to="item.path" replace :icon="item.icon">
        {{ item.name }}
      </van-tabbar-item>
    </template>
  </van-tabbar>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      list: [
        {
          id: '1',
          name: '首页',
          path: '/home',
          icon: 'home-o',
        },
        {
          id: '2',
          name: '购物车',
          path: '/cart',
          icon: 'cart-o',
        },
      ],
    }
  },
  methods: {},
}
</script>

<style></style>
